alert("The combination of text and settings you have chosen would generate an " & "animation of more than 32000 frames. Please simplify your selections and try again.")
return 0
end if
tell the stage
set iUsersScoreSelection to the scoreSelection
set iLastFrame to the lastFrame
set iStageRight to the stageRight
set iStageBottom to the stageBottom
set iStageWidth to iStageRight - the stageLeft
set iStageHeight to iStageBottom - the stageTop
end tell
if iUsersScoreSelection = [] then
alert("Please select a range of cells or frames in the score and try again.")
return 0
end if
if gDevelopmentFlag then
mForceSelection(me)
end if
set iLocReselect to the loc of sprite ichReselect
puppetSprite(ichReselect, 1)
set firstScoreSelectionList to getAt(iUsersScoreSelection, 1)
set ichStart to getAt(firstScoreSelectionList, ikChStart)
set ichEnd to getAt(firstScoreSelectionList, ikChEnd)
set iFrameStart to getAt(firstScoreSelectionList, ikFrameStart)
set iFrameEnd to getAt(firstScoreSelectionList, ikFrameEnd)
set theGeneratedFrameEnd to iFrameStart + nFramesNeeded - 1
set theEnd to max(theGeneratedFrameEnd, iFrameEnd)
if theEnd >= iLastFrame then
set iNeedClean to 1
tell the stage
beginRecording()
go(theEnd + 5)
set the frameTempo to 5
endRecording()
end tell
else
set iNeedClean to 0
end if
set iChannelAvailList to []
if (ichStart = -5) and (ichEnd = 48) then
repeat with ch = 1 to 48
add(iChannelAvailList, ch)
end repeat
tell the stage
beginRecording()
if iFrameEnd >= iFrameStart then
go(iFrameStart)
repeat with theFrameNum = iFrameStart to iFrameEnd
set the frameLabel to 0
deleteFrame()
end repeat
end if
tell the stage
if iFrameStart = 1 then
go(1)
else
go(iFrameStart - 1)
end if
repeat with i = 1 to nFramesNeeded
insertFrame()
end repeat
if iFrameStart = 1 then
go(1)
else
go(iFrameStart - 1)
end if
end tell
set theEnd to max(theGeneratedFrameEnd, iFrameEnd)
if theEnd >= iLastFrame then
set iNeedClean to 1
go(theEnd + 5)
set the frameTempo to 5
else
set iNeedClean to 0
end if
endRecording()
end tell
set iGeneratedScoreSelection to [[-5, 48, iFrameStart, theGeneratedFrameEnd]]
else
set iGeneratedScoreSelection to []
set nItems to count(iUsersScoreSelection)
repeat with thisSelection = 1 to nItems
set thisScoreSelectionList to getAt(iUsersScoreSelection, thisSelection)
set thisChStart to getAt(thisScoreSelectionList, ikChStart)
if thisChStart <= 0 then
alert("Please make your score selection in channels 1 through 48")
mClean(me)
return 0
end if
set thisChEnd to getAt(thisScoreSelectionList, ikChEnd)
set thisScoreSelection to [thisChStart, thisChEnd, iFrameStart, theGeneratedFrameEnd]